import 'package:casdon/modules/recipe/ui/widgets/Recipe_card_item.dart';

class RecipeListState {
  final List<RecipeCardData> data;
  final int totalSize;
  final int page;
  final int pageSize;
  final bool isLoadingMore;
  final bool hasMore;

  RecipeListState copyWith({
    List<RecipeCardData>? data,
    int? totalSize,
    int? page,
    int? pageSize,
    bool? isLoadingMore,
    bool? hasMore,
  }) {
    return RecipeListState(
      data: data ?? this.data,
      totalSize: totalSize ?? this.totalSize,
      page: page ?? this.page,
      pageSize: pageSize ?? this.pageSize,
      isLoadingMore: isLoadingMore ?? this.isLoadingMore,
      hasMore: hasMore ?? this.hasMore,
    );
  }

  factory RecipeListState.initial() => RecipeListState(
    data: [],
    totalSize: 0,
    pageSize: 20,
    page: 1,
    isLoadingMore: false,
    hasMore: false,
  );

  RecipeListState({
    required this.data,
    this.totalSize = 0,
    this.page = 1,
    required this.pageSize,
    this.isLoadingMore = false,
    this.hasMore = false,
  });
}
